Matthias Clasen [Tue, 11 Jun 2019 17:09:10 +0000 (17:09 +0000)]
widget: Improve focus handling
Make gtk_widget_real_focus do the right
thing for focusable widgets with children.
A case where this is (now) relevant is
an entry with a context popover.
Matthias Clasen [Tue, 11 Jun 2019 15:48:07 +0000 (15:48 +0000)]
testsuite: Be robust against broken focus
When we start cycling on a subset, abort
after a while.
Matthias Clasen [Tue, 11 Jun 2019 14:53:08 +0000 (14:53 +0000)]
testsuite: more focus-chain output
Differentiate between wrapping around and
stopping at the end of the focus chain.
Update the existing tests, and add two
new ones where the difference matters.
Matthias Clasen [Tue, 11 Jun 2019 14:28:04 +0000 (14:28 +0000)]
Merge branch 'focus-chain-test' into 'master'
Focus chain test
See merge request GNOME/gtk!927
Matthias Clasen [Tue, 11 Jun 2019 14:11:28 +0000 (14:11 +0000)]
Add a focus chain test
Add a test that enumerates the focus chain by
emitting move-focus repeatedly, and compares
the result to expected output.
The test expects a ui file and a reference
file as input. The reference file can be created
using the --generate option.
Matthias Clasen [Tue, 11 Jun 2019 13:14:25 +0000 (13:14 +0000)]
window: Fix focus wraparound
If tab focus falls off the end, and we have an empty headerbar,
we end up with window->focus == NULL. Don't let that happen
Daniel Mustieles [Tue, 11 Jun 2019 10:56:08 +0000 (12:56 +0200)]
Updated Spanish translation
Yuras Shumovich [Mon, 10 Jun 2019 17:19:08 +0000 (17:19 +0000)]
Update Belarusian translation
Matthias Clasen [Mon, 10 Jun 2019 03:10:13 +0000 (03:10 +0000)]
Rename a bunch of private headers
We want to follow the convention that all
private headers have names ending in private.h
Matthias Clasen [Mon, 10 Jun 2019 02:19:53 +0000 (02:19 +0000)]
Adwaita: Make selection in menus visible
Benjamin Otte [Sun, 9 Jun 2019 21:35:15 +0000 (21:35 +0000)]
Merge branch 'for-master' into 'master'
testsuite: Make creating the output dir not racy
Closes #1942
See merge request GNOME/gtk!924
Benjamin Otte [Sun, 9 Jun 2019 19:49:44 +0000 (21:49 +0200)]
testsuite: Make creating the output dir not racy
Fixes #1942
Georges Basile Stavracas Neto [Sun, 9 Jun 2019 18:50:43 +0000 (18:50 +0000)]
Merge branch 'gbsneto/install-gtkpopovermenubar-h' into 'master'
Install gtkpopovermenubar.h
See merge request GNOME/gtk!923
Georges Basile Stavracas Neto [Sun, 9 Jun 2019 18:40:55 +0000 (15:40 -0300)]
build: Install gtkpopovermenubar.h
It is not listed in 'gtk_public_headers', so it is not
installed, and breaks anyone including gtk.h
Matthias Clasen [Sun, 9 Jun 2019 18:13:55 +0000 (18:13 +0000)]
Merge branch 'new-style-menu' into 'master'
New style menu
See merge request GNOME/gtk!916
Matthias Clasen [Sun, 9 Jun 2019 16:53:59 +0000 (16:53 +0000)]
popovermenubar: Add docs
Matthias Clasen [Sun, 9 Jun 2019 16:45:50 +0000 (16:45 +0000)]
Typo fix
Matthias Clasen [Sun, 9 Jun 2019 16:19:07 +0000 (16:19 +0000)]
Rename GtkPopoverBar to GtkPopoverMenuBar
Clarity over beauty.
Matthias Clasen [Sun, 9 Jun 2019 16:04:12 +0000 (16:04 +0000)]
popover bar: Add setters
Add setters/getters for the menu-model property.
Matthias Clasen [Sun, 9 Jun 2019 15:24:37 +0000 (15:24 +0000)]
Adwaita: Adapt to popover bar changes
Add some initial styling for popover bars
and popover menus. This needs revision.
Matthias Clasen [Sun, 9 Jun 2019 15:23:47 +0000 (15:23 +0000)]
popoverbar: Use a box layout
Its the cool way to do layout these days.
Matthias Clasen [Sun, 9 Jun 2019 14:09:20 +0000 (14:09 +0000)]
main: Warn if GDK sends us bad focus events
The new rule for focus events from the windowing
system is: We only want them for toplevels. If you
put focus on popups, we don't want to know about
it, and you still need to deliver key events to
the toplevel.
Matthias Clasen [Sun, 9 Jun 2019 14:08:18 +0000 (14:08 +0000)]
popover menu: Disappear on focus out
We try to keep focus inside by wrapping arrow keynav.
But focus can still escape. If it does, we want to
disappear, like any good menu should.
Matthias Clasen [Sun, 9 Jun 2019 14:03:40 +0000 (14:03 +0000)]
popover bar: Don't grab focus away from open menus
It makes them unhappy and disappear.
Matthias Clasen [Sun, 9 Jun 2019 04:19:40 +0000 (04:19 +0000)]
Expand focus tests
Matthias Clasen [Sun, 9 Jun 2019 02:25:12 +0000 (02:25 +0000)]
popover menu: Implement focus
We want to cycle around for up/down arrows.
Matthias Clasen [Sun, 9 Jun 2019 02:23:47 +0000 (02:23 +0000)]
popover bar: Implement focus
This is the proper way to do focus.
We want to cycle around for left/right arrows.
Matthias Clasen [Sun, 9 Jun 2019 02:21:05 +0000 (02:21 +0000)]
model button: Make left/right switch submenus
This is expected menu keynav behavior: If the
focused item has a submenu, open it on right
arrow press. And if we are in a submenu title,
make left arrow press close it.
Matthias Clasen [Sun, 9 Jun 2019 02:19:30 +0000 (02:19 +0000)]
menu button: Use proper focus api
Widgets are supposed to call gtk_widget_child_focus.
Calling internal focus_move function directly makes
us skip the childs ::focus() implementation, which
is where the magic happens.
Matthias Clasen [Sat, 8 Jun 2019 17:48:29 +0000 (17:48 +0000)]
popover bar: Add arrow keynav
Make left/right cycle the active item
among the bars children. Separate the styling
for the active item from :hover, since it is
a separate state, and only mixed up in menus
for historical reasons.
Matthias Clasen [Sat, 8 Jun 2019 15:28:22 +0000 (15:28 +0000)]
widget-factory: Move the popover bar to the ui file
Matthias Clasen [Sat, 8 Jun 2019 15:27:52 +0000 (15:27 +0000)]
popover bar: Add a model property
This makes it less annoying to use in ui files.
Matthias Clasen [Sat, 8 Jun 2019 13:46:38 +0000 (13:46 +0000)]
widget-factory: Don't use Return as accel
This is a bad idea, as it interacts badly with
general use of Return for activation.
Matthias Clasen [Sat, 8 Jun 2019 13:42:18 +0000 (13:42 +0000)]
popover bar: Break out items
These will grow enough functionality that its
worth having an object for it.
Matthias Clasen [Sat, 8 Jun 2019 13:40:59 +0000 (13:40 +0000)]
label: Fix mnemonic visibility handling
With non-widgets having children, we can no
longer assume that using gtk_container_forall
lets us walk the entire tree.
Matthias Clasen [Sat, 8 Jun 2019 13:40:37 +0000 (13:40 +0000)]
widget factory: Add mnemonics in popovers
These don't work!
Matthias Clasen [Sat, 8 Jun 2019 13:39:53 +0000 (13:39 +0000)]
gdk: Always deliver key events to toplevels
This is just a hack to see that this works.
Eventually, the backends should do the right
thing.
Matthias Clasen [Sat, 8 Jun 2019 03:23:22 +0000 (03:23 +0000)]
popover bar: towards menubar-like behavior
Make the open popover follow the pointer.
Matthias Clasen [Sat, 8 Jun 2019 03:16:31 +0000 (03:16 +0000)]
widget: Ignore natives for picking
The natives transforms are not set up properly
to make this work, so ignore them here, for now.
This my need to be revisited later.
Matthias Clasen [Sat, 8 Jun 2019 03:14:02 +0000 (03:14 +0000)]
popover: Respect alignment for positioning
We lost the code that takes the halign of
the popover into account when positioning it.
Bring it back, since we want to use it for
popover menus.
Matthias Clasen [Fri, 7 Jun 2019 18:05:57 +0000 (18:05 +0000)]
widget factory: Redo the menubar with a model
No UI change intended, except for the fact that
actions don't do inconsistent states for checks
and radios.
Matthias Clasen [Fri, 7 Jun 2019 23:27:24 +0000 (23:27 +0000)]
Introduce a popover bar
This is meant to grow into a menubar replacement
with popovers. For now, it is just a box of menubuttons,
and not very much like a menubar at all.
Matthias Clasen [Fri, 7 Jun 2019 17:05:48 +0000 (17:05 +0000)]
Rationalize popover menu apis
Make gtk_popover_new_from_model() return a GtkPopoverMenu,
rename it to gtk_popover_menu_new_from_model() and add
a relative_to argument to gtk_popover_menu_new().
Update all callers.
Matthias Clasen [Fri, 7 Jun 2019 15:37:08 +0000 (15:37 +0000)]
Stop exporting gtk_popover_bind_model
We can't improve popover menus as long as we
have to be able to work with any old popover
we're given. Remove this, so we can make
gtk_popover_new_from_model return a subclass.
Matthias Clasen [Fri, 7 Jun 2019 03:20:45 +0000 (03:20 +0000)]
box layout: Handle native children
These need to be skipped in measuring,
and we need to call gtk_native_check_resize
on them during allocation.
This was showing up as the new-style
context menu in widget-factory forcing
its relative-to box to grow when its
shown.
Matthias Clasen [Fri, 7 Jun 2019 02:37:24 +0000 (02:37 +0000)]
modelbutton: Sizing fixes
We only want to reserve indicator size if
there are any checks or radios in the popover.
Unfortunately, GtkIcon has a hardcoded min-size
of 16, defeating this use. Work around by
wrapping each indicator in a box, and showing/
hiding the actual indicator.
Matthias Clasen [Fri, 7 Jun 2019 01:25:59 +0000 (01:25 +0000)]
widget factory: Add a context menu example
This is also taken from
https://gitlab.gnome.org/Teams/Design/os-mockups/blob/master/menus/menu-design-patterns.png
Matthias Clasen [Thu, 6 Jun 2019 18:08:52 +0000 (18:08 +0000)]
popover menu: Fix style classes
We want the same style classes that are produced
when creating a popover from a menu model.
Matthias Clasen [Thu, 6 Jun 2019 18:08:13 +0000 (18:08 +0000)]
widget factory: Improve manual popover menu example
Set up the size group, so things line up.
Matthias Clasen [Thu, 6 Jun 2019 01:37:37 +0000 (01:37 +0000)]
widget-factory: Redo the new-style menu
Do this from a menu model first, since that
is easier to get right.
Matthias Clasen [Fri, 7 Jun 2019 13:03:10 +0000 (13:03 +0000)]
menu section box: Add style classes for display hints
This makes it easier to realize some of the new
styles for popover menus.
Matthias Clasen [Thu, 6 Jun 2019 01:36:17 +0000 (01:36 +0000)]
menu section box: Introduce more section variants
Allow display-hint to be circular-buttons or
inline-buttons, to produce variations of horizontal
button layouts.
Matthias Clasen [Thu, 6 Jun 2019 23:04:52 +0000 (23:04 +0000)]
model button: Look up accels if needed
When we are not given an explicit accel (as is
the case when the popover is constructed from
a model), then look it up from the GtkApplication
at map time.
Matthias Clasen [Fri, 7 Jun 2019 13:02:45 +0000 (13:02 +0000)]
model button: Show shortcuts
Most of the machinery for this is already
in place. We just need to add an accel property
to GtkMenuButton and pass it through.
Matthias Clasen [Thu, 6 Jun 2019 00:41:45 +0000 (00:41 +0000)]
model button: Redo layout
Move checks to the left, and introduce a size group
to align things. The size group is provided by the
parent, using the new ::indicator-size-group property.
Matthias Clasen [Wed, 5 Jun 2019 19:36:35 +0000 (19:36 +0000)]
widget-factory: Add another popover menu example
This one is taken from
https://gitlab.gnome.org/GNOME/gtk/issues/1824
Matthias Clasen [Wed, 5 Jun 2019 22:31:14 +0000 (22:31 +0000)]
model button: Drop centered, inverted properties
These properties were only useful for titles,
and we have a role for that now.
Matthias Clasen [Wed, 5 Jun 2019 21:22:01 +0000 (21:22 +0000)]
model button: Add a role for titles
This gets us out of using direct presentational
markup like 'inverted' and 'centered' and will
make it easier to play with different layout.
Use the new role when creating popover
menus from models.
Matthias Clasen [Wed, 5 Jun 2019 19:33:43 +0000 (19:33 +0000)]
model button: Small fixes
Make iconic model buttons work better.
Piotr Drąg [Sun, 9 Jun 2019 15:29:12 +0000 (17:29 +0200)]
Update POTFILES.skip
Christian Hergert [Thu, 6 Jun 2019 23:08:13 +0000 (16:08 -0700)]
config.h: fix stray #
Matthias Clasen [Thu, 6 Jun 2019 22:39:44 +0000 (22:39 +0000)]
Merge branch 'wip/chergert/set-va-marshallers' into 'master'
va_marshaller: add various va_marshallers
See merge request GNOME/gtk!917
Christian Hergert [Thu, 6 Jun 2019 22:27:54 +0000 (15:27 -0700)]
va_marshaller: add various va_marshallers
We don't need to cover every case with a va_marshaller, but there are a
number of them that are useful because they will often only be connected
to by a single signal handler.
Generally speaking, if I opened into a file to add a va_marshaller, I just
set all of them.
Matthias Clasen [Wed, 5 Jun 2019 12:10:24 +0000 (12:10 +0000)]
Merge branch 'wip/matthiasc/shared-glyph-cache' into 'master'
Share the glyph cache
See merge request GNOME/gtk!912
Matthias Clasen [Wed, 5 Jun 2019 12:03:39 +0000 (12:03 +0000)]
Cosmetics
Rename some arguments, since atlases->atlases is awful.
Matthias Clasen [Wed, 5 Jun 2019 12:00:53 +0000 (12:00 +0000)]
texture atlas: Add a missing initialization
Pointed out by Timm.
Matthias Clasen [Wed, 5 Jun 2019 10:56:25 +0000 (10:56 +0000)]
Merge branch 'theme-load' into 'master'
Add a theme loading benchmark
See merge request GNOME/gtk!913
Matthias Clasen [Sat, 1 Jun 2019 21:25:55 +0000 (21:25 +0000)]
render node: Optimize type checks
The GSK_IS_RENDER_NODE macro is a bit silly,
and not worth having in g_return_if_fail checks
in trivial getters.
Matthias Clasen [Sat, 1 Jun 2019 21:55:14 +0000 (21:55 +0000)]
surface: Use surface->display directly
No need to go through a public getter
for internal uses.
Matthias Clasen [Wed, 5 Jun 2019 03:23:13 +0000 (03:23 +0000)]
Add a theme loading benchmark
Matthias Clasen [Wed, 5 Jun 2019 02:49:07 +0000 (02:49 +0000)]
Fix a refcounting mishap
We were missing a ref, causing caches to go missing
when a window is opened twice.
Matthias Clasen [Wed, 5 Jun 2019 00:31:53 +0000 (00:31 +0000)]
Bring brink skip_allocate
This was removed by accident in
580aa8204f45768,
together with some no longer needed popover
special-casing.
Matthias Clasen [Tue, 4 Jun 2019 23:11:18 +0000 (23:11 +0000)]
Remove debug spew
Timm Bäder [Tue, 4 Jun 2019 17:28:59 +0000 (17:28 +0000)]
Consider all offscreen drawings for the icon cache
Matthias Clasen [Tue, 4 Jun 2019 21:27:09 +0000 (21:27 +0000)]
Share glyph and icon caches
Use the same texture atlases to back both
the glyph and icon caches, and unify their
sizes and management. Store big glyphs
in separate textures, so all atlases have
the same size. Tweak some of the eviction
parameters.
We share the caches across all GL contexts
on a display, unless the GSK_NO_SHARED_CACHES
env var is set.
Matthias Clasen [Tue, 4 Jun 2019 21:26:28 +0000 (21:26 +0000)]
gdk: Create a global shared GL context
Create a global GL context that connects all
GL contexts on a display and lets us share textures
between them.
Matthias Clasen [Mon, 3 Jun 2019 19:00:17 +0000 (19:00 +0000)]
glyph cache: Stop storing driver and render
This is the first step towards sharing glyph
caches across renderers.
Matthias Clasen [Sun, 2 Jun 2019 17:59:25 +0000 (17:59 +0000)]
gl: Use pad-extend for icon cache
Repeat the border pixels to avoid artifacts from
linear scaling.
Matthias Clasen [Sun, 2 Jun 2019 16:59:52 +0000 (16:59 +0000)]
gl: Use linear scaling for atlases
Matthias Clasen [Sun, 2 Jun 2019 16:47:57 +0000 (16:47 +0000)]
gl: Allow setting min/mag filter on textures
This will be used in the future.
Adapt all callers to pass GL_NEAREST for now.
Matthias Clasen [Sun, 2 Jun 2019 16:41:54 +0000 (16:41 +0000)]
gl: Add 1 pixel of padding in the icon cache
Matthias Clasen [Sun, 2 Jun 2019 16:02:31 +0000 (16:02 +0000)]
glyph cache: Reinstate 1 pixel padding
This is necessary to prevent bleeding.
Matthias Clasen [Sun, 2 Jun 2019 15:11:11 +0000 (15:11 +0000)]
gl: Don't leak texture atlases
We need to free the texture atlases, and the
textures backing them.
Matthias Clasen [Sun, 2 Jun 2019 15:10:40 +0000 (15:10 +0000)]
gl: Free icon data
Matthias Clasen [Sun, 2 Jun 2019 15:08:20 +0000 (15:08 +0000)]
glyph cache: Clarify message
We have different kinds of caches now.
Timm Bäder [Wed, 22 May 2019 07:33:25 +0000 (09:33 +0200)]
gl renderer: Add & use icon cache
Upload small icons all to the same texture atlas.
Timm Bäder [Thu, 14 Feb 2019 14:22:40 +0000 (15:22 +0100)]
glimage: Only support uploading one region
Timm Bäder [Wed, 22 May 2019 05:33:45 +0000 (07:33 +0200)]
gl renderer: Move texture atlas into its own file
We want to reuse the code later.
Timm Bäder [Sun, 10 Feb 2019 09:12:47 +0000 (10:12 +0100)]
glglyphcache: Use stb_rect_pack for better glyph packing
Benjamin Otte [Tue, 4 Jun 2019 14:59:32 +0000 (14:59 +0000)]
docs: Remove mention of queue_draw_area()
and queue_draw_region(). They're gone since
73650c6da2b6171d10633038f74088980e8a7fc7.
Timm Bäder [Tue, 4 Jun 2019 14:32:49 +0000 (16:32 +0200)]
rendernodeimpl: Inline container_node_get_bounds into _new
It's the only caller of the function and we can avoid a second loop over
all child nodes this way.
Timm Bäder [Tue, 4 Jun 2019 14:14:30 +0000 (16:14 +0200)]
snapshot: Make append_node_internal transfer-full
There is only one case where we do *not* directly unref the node again
after calling this.
Benjamin Otte [Tue, 4 Jun 2019 04:24:28 +0000 (04:24 +0000)]
Merge branch 'for-master' into 'master'
For master
See merge request GNOME/gtk!911
Benjamin Otte [Mon, 3 Jun 2019 23:45:17 +0000 (01:45 +0200)]
widget-factory: Show proper separators
Benjamin Otte [Tue, 4 Jun 2019 04:09:31 +0000 (06:09 +0200)]
builder: Allow values of type GType
In particular this allows setting the item-type property of GListStore.
Benjamin Otte [Tue, 4 Jun 2019 03:54:16 +0000 (05:54 +0200)]
builder: Make GListStore buildable
Treats GListStore like any other object and allows <child> to add items
to it.
Benjamin Otte [Mon, 3 Jun 2019 16:21:10 +0000 (18:21 +0200)]
testsuite: Add tests for printing/parsing transforms
Matthias Clasen [Mon, 3 Jun 2019 16:41:17 +0000 (16:41 +0000)]
Merge branch 'transform-tests' into 'master'
Transform tests
See merge request GNOME/gtk!910
Matthias Clasen [Mon, 3 Jun 2019 16:18:55 +0000 (16:18 +0000)]
gsk: Add some more transform tests
Tests around identity. Seems trivial, but
still managed to find a bug.
Matthias Clasen [Mon, 3 Jun 2019 16:19:57 +0000 (16:19 +0000)]
gsk: Fix printing of identity transforms
These need to print as "none", otherwise
the parser does not accept them.